package com.pro.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.Objects;

/**
 * ClassName:JsMicroLog
 * Package:com.pro.pojo
 * Description: 微圈操作日志
 *
 * @Date:2021/12/2 下午 8:29
 * @Author: WYH
 */
public class JsMicroLog {
    private long logId;//日志id
    private String tableName;//操作表名
    private String type;//操作类型，2添加，3删除，4修改，5查找
    private long userId;//操作人

    @DateTimeFormat(pattern="yyyy-MM-dd")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date createDate;//操作时间

    private String remark;//备注
    private Integer logType;//操作日志类型1、商品、2视频、3、微圈
    private String trueName;//后台用户名称

    public void setTrueName(String trueName) {
        this.trueName = trueName;
    }

    public String getTrueName() {
        return trueName;
    }

    public JsMicroLog() {
    }

    @Override
    public String toString() {
        return "JsMicroLog{" +
                "logId=" + logId +
                ", tableName='" + tableName + '\'' +
                ", type='" + type + '\'' +
                ", userId=" + userId +
                ", createDate=" + createDate +
                ", remark='" + remark + '\'' +
                ", logType=" + logType +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        JsMicroLog that = (JsMicroLog) o;
        return logId == that.logId &&
                userId == that.userId &&
                Objects.equals(tableName, that.tableName) &&
                Objects.equals(type, that.type) &&
                Objects.equals(createDate, that.createDate) &&
                Objects.equals(remark, that.remark) &&
                Objects.equals(logType, that.logType);
    }

    @Override
    public int hashCode() {
        return Objects.hash(logId, tableName, type, userId, createDate, remark, logType);
    }

    public void setLogId(long logId) {
        this.logId = logId;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public void setType(String type) {
        this.type = type;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public void setLogType(Integer logType) {
        this.logType = logType;
    }

    public long getLogId() {
        return logId;
    }

    public String getTableName() {
        return tableName;
    }

    public String getType() {
        return type;
    }

    public long getUserId() {
        return userId;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public String getRemark() {
        return remark;
    }

    public Integer getLogType() {
        return logType;
    }

    public JsMicroLog(long logId, String tableName, String type, long userId, Date createDate, String remark, Integer logType) {
        this.logId = logId;
        this.tableName = tableName;
        this.type = type;
        this.userId = userId;
        this.createDate = createDate;
        this.remark = remark;
        this.logType = logType;
    }
}
